package com.itheima.demo;

import com.itheima.cofig.SpringCofiguration;
import com.itheima.service.UserService;
import com.itheima.service.impl.UserServiceImpl;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;

public class UserController {
   public static void main(String[] args) {
       //ClassPathXmlApplicationContext app=new  ClassPathXmlApplicationContext("applicationContext.xml");
       ApplicationContext app=new AnnotationConfigApplicationContext(SpringCofiguration.class);
       //ApplicationContext app=new FileSystemXmlApplicationContext("D:\\Mao\\Spring\\spring\\itheima_spring_ioc\\src\\main\\resources\\applicationContext.xml");
     UserService userService= app.getBean(UserService.class);
     userService.save();
    }
}
